<%@ page import="top.majuan.study.javawebjdbc.entity.TbClass" %>
<%@ page import="top.majuan.study.javawebjdbc.dao.TbClassDAO" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加班级数据</title>
</head>
<body>
  <%
      request.setCharacterEncoding("UTF-8");
      TbClass tbClass = new TbClass();
      tbClass.setClassname(request.getParameter("classname"));
      tbClass.setClassinfo(request.getParameter("classinfo"));
      int i = TbClassDAO.insert(tbClass);
      String message = "添加失败";
      if (i == 1) {
          message = "添加成功";
      }
  %>

<script>
    alert("<%=message%>");
    location.href = "insert.jsp";
</script>







</body>
</html>
